// $Id: RefreshHandler.java 42 2011-10-05 19:27:28Z huijzer@gmail.com $
package lime.application.command;

import lime.application.view.Refreshable;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.handlers.HandlerUtil;

public class RefreshHandler extends AbstractHandler {
	
	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		IWorkbenchPart part = HandlerUtil.getActivePart(event);
		if (part instanceof Refreshable) {
			Refreshable view = (Refreshable) part;
			view.refresh();
		}
		return null;
	}
	
}